; (function($){
// Data type detector
if(!$.is){ $.is = {}; }
$.extend($.is, {
    array: function(object){ return object instanceof Array},
    bool: function(object){ return typeof object == "boolean"; },
    element: function(object){ return element.nodeName },
    string: function(object){ return typeof object == "string"; },
    empty: function(object){
        return object == null
            || object == ""
            || object === false
            || object === [];
    },
    object: function(object){ return (typeof object == "object" && object != null); },
    func: function(object){ return typeof object == "function"; },
    number: function(object){
        return typeof object == "number"
            || typeof parseInt(object) == "number"
            || typeof parseFloat(object) == "number";
    },
    defined: function(object){ return (typeof object) == "undefined" ? false : true; }
});
// Some utility wrapper methods
$.fn.extend({
    swapClass: function(className1, className2){
        return this.each(function(){
            $(this).toggleClass(className1).toggleClass(className2);
        });
    },
    update: function(content){
        return this.each(function(){
            $(this).empty().append(content);
        });
    }
});
// Debug methods
$.console = {
    flag: !!window.console || !!window.firebug,
    log: function(msg){
        if(!$.console.flag){ return false; }
        if($.is.object(msg)){
            return $.console.dir(msg);
        }else{
            window.console.log($.console.time() + ": " + msg);
        }
    },
    dir: function(/*object, title*/){
        if(!$.console.flag){ return false; }
        if(arguments[1] && $.is.string(arguments[1])){
            window.console.log(arguments[1]);
        }
        window.console.log(arguments[0]);
    },
    time: function(){
        return (new Date()).toTimeString();
    }
};

$.log = $.console.log;
$.time = $.console.time;
})(jQuery);